﻿create or replace function posTerminalModelToXml(bigint, text)
returns xml as
$$
declare
  posTerminalModelId alias for $1;
  posTerminalModelName alias for $2;
begin

  return
	xmlelement( 
		name posterminalmodel, xmlattributes(posTerminalModelId as id), xmlelement(name posterminalmodelname, posTerminalModelName)
		)
  ;

end;
$$ language plpgsql IMMUTABLE; -- same result for same data